<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSwtManagerTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admin_manager', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('group_id')->comment('团队ID');
            $table->integer('user_id')->comment('负责人ID');
            $table->string('title')->default('')->comment('标题');
            $table->string('description')->default('')->comment('简介');
            $table->integer('manager_type')->comment('项目类型');
            $table->dateTime('start_time')->comment('起始时间');
            $table->dateTime('end_time')->comment('起始时间');
            $table->string('address')->default('')->comment('地址');
            $table->string('longitude')->default('')->comment('经度');
            $table->string('latitude')->default('')->comment('纬度');
            $table->decimal('target_amount',10,2)->comment('目标金额');
            $table->string('personal_donation_amount')->default('20,50,100')->comment('个人捐款金额');
            $table->string('corporate_donation_amount')->default('20,50,100')->comment('企业捐款金额');
            $table->string('random_donation_amount')->nullable()->default('0')->comment('随缘捐金额 0为关闭');
            $table->string('cover_path')->default('')->comment('封面');
            $table->tinyInteger('excess_donation')->default('0')->comment('超额捐款 0禁止 1允许');
            $table->text('content')->comment('内容');
            $table->integer('beneficiaries')->default('0')->nullable()->comment('受益人数量');
            $table->string('beneficiary_name')->nullable()->comment('受益人名称');
            $table->tinyInteger('online_status')->default('0')->nullable()->comment('上线状态 0未上线 1已上线');
            $table->integer('certificate_template_id')->default('0')->nullable()->comment('证书模板ID 0为默认');
            $table->integer('payment_channel')->default('0')->nullable()->comment('收款渠道ID 0为默认');
            $table->json('personalized_donation')->nullable()->comment('个性化捐款');
            $table->tinyInteger('donation_type')->default('0')->nullable()->comment('捐赠模式 0专业1精简 2自定义金额');
            $table->tinyInteger('donate_together')->default('1')->nullable()->comment('一起捐 0禁止 1允许');
            $table->string('registration_number')->nullable()->comment('备案号');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admin_manager');
    }
}
